//
//  CarcircleTitleCell.m
//  CarUser
//
//  Created by 王森林 on 2019/1/19.
//  Copyright © 2019年 王森林. All rights reserved.
//

#import "CarcircleTitleCell.h"

@interface CarcircleTitleCell()
@property (nonatomic,strong) UILabel *lineLabel;
@property (nonatomic,strong) UILabel *titleLabel;
@end

@implementation CarcircleTitleCell

-  (void)setData:(id)data
{
    
    [self createUIWithData];
}

- (void)createUIWithData
{
    [self.contentView addSubview:self.lineLabel];
    [self.contentView addSubview:self.titleLabel];
    self.titleLabel.text = @"热门更新";
    
    [self.lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left).offset(15);
        make.width.mas_equalTo(4);
        make.height.mas_equalTo(15);
        make.top.mas_equalTo(self.contentView.mas_top).offset(8);
        make.bottom.mas_equalTo(self.contentView.mas_bottom).offset(-14);
    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.lineLabel.mas_right).offset(15);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(15);
        make.top.mas_equalTo(self.contentView.mas_top).offset(8);
    }];
    
    
}

- (UILabel *)titleLabel
{
    if (!_titleLabel) {
        _titleLabel = [UILabel new];
        _titleLabel.textColor = [UIColor blackColor];
        _titleLabel.font = B_FONT_SIZE(16);
        _titleLabel.numberOfLines = 0;
    }
    return _titleLabel;
}

- (UILabel *)lineLabel
{
    if (!_lineLabel) {
        _lineLabel = [UILabel new];
        _lineLabel.backgroundColor = RGB(153, 153, 153);
        _lineLabel.layer.cornerRadius = 3;
        _lineLabel.layer.masksToBounds = YES;
        
    }
    return _lineLabel;
}
@end
